package com.bonc.sdk.gofakeit.v1;

import com.bonc.sdk.core.ClientBuilder;
import com.bonc.sdk.core.HcClient;
import com.bonc.sdk.core.invoker.AsyncInvoker;
import com.bonc.sdk.gofakeit.v1.model.ShowCarRequest;
import com.bonc.sdk.gofakeit.v1.model.ShowCarResponse;

import java.util.concurrent.CompletableFuture;

public class FakeItAsyncClient {

    protected HcClient hcClient;

    public FakeItAsyncClient(HcClient hcClient) {
        this.hcClient = hcClient;
    }

    public static ClientBuilder<FakeItAsyncClient> newBuilder() {
        ClientBuilder<FakeItAsyncClient> clientBuilder = new ClientBuilder<>(FakeItAsyncClient::new);
        return clientBuilder;
    }


    /**
     * 查询应用模板详情
     *
     * 查询应用模板详情。
     * 
     * Please refer to HUAWEI cloud API Explorer for details.
     *
     * @param request 请求对象
     * @return CompletableFuture<ShowCarResponse>
     */
    public CompletableFuture<ShowCarResponse> showCarAsync(ShowCarRequest request) {
        return hcClient.asyncInvokeHttp(request, FakeItMeta.showAppDetail);
    }

    /**
     * 查询应用模板详情
     *
     * 查询应用模板详情。
     * 
     * Please refer to HUAWEI cloud API Explorer for details.
     *
     * @param request 请求对象
     * @return AsyncInvoker<ShowAppDetailRequest, ShowCarResponse>
     */
    public AsyncInvoker<ShowCarRequest, ShowCarResponse> showAppDetailAsyncInvoker(
            ShowCarRequest request) {
        return new AsyncInvoker<ShowCarRequest, ShowCarResponse>(request, FakeItMeta.showAppDetail, hcClient);
    }
}
